home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-seriously_amiga-
/
sound
/
aplayer
/
files
/
arexx.lha
/
Authorize1.2.aplay
< prev
next >
Wrap
Text File
|
1996-11-17
|
4KB
|
117 lines
/****************************************************************/
/* This is an script for use with Aplayer to write the module's */
/* author to the commentstring. */
/* Install it on a f-button, and when you run it, it will show */
/* a requester asking you if you want to change the comment. */
/* The script will save the string as "Author: [the author]" */
/* (double-quotes not included). */
/* */
/* This script requires the RexxReqTools.library to work. It */
/* should be included in the ReqTools package. */
/* RexxReqTools is Copyright © Rafael D'Halleweyn. */
/* */
/* Don't know how to use the main requester? */
/* Press the "Help!" gadget for an explanation. */
/* */
/* This tiny script was written by Anders Torin in 1996-07-11. */
/* If you want to reach me, my e-mail address is: */
/* anders@artworks.apana.org.au */
/* */
/* Fixed and debugged by Johan Torin in 96-07-11 :) */
/* */
/* If you use this script, why don't you mail me and tell me */
/* your opinions about it? :) */
/****************************************************************/
NL='0A'X
/* Some initiating stuff */
Address APLAYER
Options Results
/* Open RexxReqTools.library */
Call Addlib("rexxreqtools.library", 0, -30, 0)
/* Get the module's author, if possible */
GetAuthor
Author = Strip(Result)
/* Get the playing module's modlist-number */
GetCMod
If Result = 0 Then Exit
/* Get the module's filename */
GetFilename Result 1
Filename = Result
/* Get the old commentstring */
Address Command 'C:List "'FileName'" lformat "%c" >T:CommTemp'
If ~Open('TempFile','T:CommTemp') Then Do
Say 'Could not open temporary file!'
Exit 20
End
OldComment = Readln('TempFile')
Call Close('TempFile')
Address Command 'C:Delete T:CommTemp >NIL:'
Do Forever /* Main loop */
/* Open a requester and ask for verification */
Msg= " The old comment happens to be: "|| NL
Msg=Msg ||" '"OldComment"'"|| NL
Msg=Msg ||""|| NL
Msg=Msg ||" The new one will automagically be set to:"|| NL
Msg=Msg ||" 'Author: "Author"'"
Interpret Call 'rtezrequest(Msg, "_Okay!|_Strip Prefix!|_Help!|_Edit!|_Cancel!", "Authorize1.2 by Anders Torin", ''rt_reqpos = reqpos_centerscr'')'
Msg = ''
If rtresult = 0 Then Exit
If rtresult = 1 Then Do
/* Write the commentstring, w/ 'Author:' in front. */
Address Command 'C:FileNote "'Filename'" "Author: 'Author'"'
Exit 0
End
If rtresult = 2 Then Do
/* Write the commentstring */
Address Command 'C:FileNote "'Filename'" "'Author'"'
Exit 0
End
If rtresult = 3 Then Do
Help= " Just pressing 'Okay!' will save the module's author to " || NL
Help=Help ||" the file like this: " || NL
Help=Help ||" 'Author: " Author"'. " || NL
Help=Help ||"" || NL
Help=Help ||" If you don't want that 'Author: ' prefix, just press the " || NL
Help=Help ||" 'Strip Prefix!' button. Then it will only be:" || NL
Help=Help ||" '"Author"'." || NL
Help=Help ||"" || NL
Help=Help ||" Pressing 'Help!' will show this box. " || NL
Help=Help ||"" || NL
Help=Help ||" If you want to change the line being saved to the" || NL
Help=Help ||" commentstring, then use the 'Edit!' button." || NL
Help=Help ||"" || NL
Help=Help ||" If you don't want to do anything of this, hit the" || NL
Help=Help ||" 'Cancel' button."
Interpret Call 'rtezrequest(Help, "Ok, I got it!", "Helprequester from Authorize1.2", ''rt_reqpos = reqpos_centerscr'')'
Help = ''
End
If rtresult = 4 Then Do
/* Put up a stringrequester */
Interpret "NewAuthor = rtgetstring(Author, , 'Enter the new author:', ,'rt_reqpos = reqpos_centerscr')"
If rtresult = 1 Then Author = NewAuthor
End
End /* Main Loop */